<template>
  <a-space direction="vertical">
    <a-date-picker v-model:value="value1" :format="dateFormat" @change="change" v-bind="$attr"/>
  </a-space>
</template>

<script>
import moment from "moment"
import { ref } from "@vue/reactivity";
export default {
    props:{
        currentVal:{
            type:String,
            required:true
        },
        dateFormat:{
            type:String,
            required:true
        }
    },
    setup(props,{emit}){
        const value1=ref(moment(props.currentVal, props.dateFormat))
        const change=(a,e)=>{
            emit("update:currentVal",e)
        }
        return{
            value1,
            change,
        }
    }
}
</script>

<style>

</style>